﻿<%@ Page Language="C#" EnableEventValidation="false"  MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="PersonEmployeeSrhForm.aspx.cs" Inherits="App_Input_PersonEmployeeSrhForm" Title="职员信息列表"%>
<%@ Import Namespace="Shpm.App.Input.Bean" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script language="javascript" >
        function jobIdChange(object)
    {
     CommonAjaxUtils.FindPositions(object.value,get_jobId_Result_CallBack);

    }
    
     function get_jobId_Result_CallBack(response)
    {
        if (response.value != null)
        {                    

            var drop = window.document.getElementById('<%=lstJob.ClientID %>');
            drop.length=0;　　　　            
            var ds = response.value;
            if(ds != null && typeof(ds) == "object")
            {                   
　　                drop.options.add(new Option("",""));
                for(var i=0; i<ds.length; i++)
                {
       
　　                var name=ds[i].JobName;
　　                var id=ds[i].JobId;
　　                drop.options.add(new Option(name,id));
                }                
            }
        }
        return
    }

</script>

    <div id="tableResult">
    <table width="100%">
      <tr>
        <td>
            <table class="table_border_line">
                <tr>
			    <td align="left" colspan="4" >
			        <script language="javascript">
                                        (new TitleBar('SearchBar', '检索条件')).showBar();
                            </script>
			    </td>						
		      </tr>
            </table>
		    <table class="table_border_line">
		      <tr>
			    <td style="width:16px; height: 26px;">&nbsp;</td>
			    <td style="width:120px; white-space:nowrap; height: 26px;" align="left">
                    部门信息</td>
			    <td align="left" style="height: 26px; width: 219px;">
                    &nbsp;<asp:DropDownList ID="lstGroup" runat="server" DataTextField="departName" DataValueField="departId"  onchange="jobIdChange(this)"></asp:DropDownList></td>
			    <td align="right" style="height: 26px; width: 3px;">&nbsp;</td>						
			    <td style="width:16px; height: 26px;">&nbsp;</td>
			    <td style="width:81px; white-space:nowrap; height: 26px;" align="left">
                    &nbsp;
                    职位信息</td>
			    <td align="left" style="height: 26px; width: 219px;">
                    <asp:DropDownList ID="lstJob" runat="server" DataTextField="JobName" DataValueField="JobId"></asp:DropDownList></td>
			    <td align="right" style="height: 26px">&nbsp;</td>									    
		      </tr>					
		      <tr>
		      </tr>	
		      <tr>
			    <td style="width:16px; height: 26px;">&nbsp;</td>
			    <td style="width:120px; white-space:nowrap; height: 26px;" align="left">
                    在职状态</td>
			    <td align="left" style="height: 26px; width: 219px;">
                    &nbsp;<asp:DropDownList ID="lstStatus" runat="server" >
                        <asp:ListItem Value="0">全部</asp:ListItem>
                        <asp:ListItem Selected = "True" Value="1">在职(试用+正式)</asp:ListItem>
                        <asp:ListItem Value="2">试用</asp:ListItem>
                        <asp:ListItem Value="3">正式</asp:ListItem>
                        <asp:ListItem Value="4">离职</asp:ListItem>
                    </asp:DropDownList></td>
			    <td align="right" style="height: 26px; width: 3px;">&nbsp;</td>						
                        <td align="left" nowrap="nowrap" style="width: 11%; height: 24px;">&nbsp;</td>
                        <td align="left" nowrap="nowrap" style="width: 81px; height: 24px;">&nbsp; 职员编号：</td>
                         <td >
                            <asp:TextBox ID="txtEmpId" runat="server" MaxLength="4" Width="55px"></asp:TextBox>
                            <asp:TextBox ID="txtEmpName" runat="server"
                             Width="87px"  BackColor="#E0E0E0" BorderColor="#E0E0E0" ForeColor="Black" contentEditable ="false" ></asp:TextBox>
                             <a  href="#" onclick="javascript:popupEmployeeSearch('<%=txtEmpId.ClientID%>', '<%=txtEmpName.ClientID %>' );">
                                 <img id="searchImg" runat="server" src="../../images/search.jpg" border="0" />
                            </a>                            
                        </td>
		      </tr>			      		      
           </table></td>
      </tr>
      <tr>
        <td align="center">
            <br />
          <table>
             <tr>
                <td style="width:80px; height: 24px;">
                    <asp:Button ID="btnSeach" runat="server" CssClass="button" Text="检 索" Width="100%" OnClick="btnSeach_Click"/></td>						
                <td style="width:80px; height: 24px;">
                    <asp:Button ID="btnNew" runat="server" CssClass="button" Text="新 建" Width="100%" OnClick="btnNew_Click"/></td>						                             
             </tr>
          </table>                  
          </td>
      </tr>
    </table>    
        <table width="100%">
            <tr>
                <td align="left" >
                <script language="javascript">
                                        (new TitleBar('SearchBar', '职员信息列表')).showBar();
                            </script>
                </td>
            </tr>
            <tr>
                <td>

                    <asp:GridView ID="viewSrhRst" runat="server" AllowPaging="True"
                        AutoGenerateColumns="False" CssClass="GridView_table" DataKeyNames="EmployeeId" OnRowCommand = "viewSrhRst_RowCommand"
                        OnPageIndexChanging="viewSrhRst_PageIndexChanging" OnRowEditing="viewSrhRst_OnRowEditing" OnRowDeleting="viewSrhRst_OnRowDeleting"
                        OnRowDataBound="viewSrhRst_RowDataBound" BorderStyle="Solid" BorderWidth="3px" >
                        <Columns>
                            <asp:BoundField HeaderText="职员编号" DataField="EmployeeId">
                                <HeaderStyle Width="5%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_center" />
                            </asp:BoundField>                        
                            <asp:BoundField HeaderText="部门编号" DataField="GroupId" Visible = "False">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>                            
                            <asp:BoundField HeaderText="职位编号" DataField="JobId" Visible = "False">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="所属部门" DataField="GroupName">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>                            
                            <asp:BoundField HeaderText="所属职位" DataField="JobName">
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                                <ItemStyle CssClass="GridView_item_left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="姓名" DataField="EmployeeName">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>    
                            <asp:BoundField HeaderText="入职日期" DataField="EmployeeDate" DataFormatString="{0:yyyy/MM/dd}" HtmlEncode = false>
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle Width="10%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>                                                      
                            <asp:BoundField HeaderText="员工状态" DataField="EmployeeStatus" Visible = "false">
                                <ItemStyle CssClass="GridView_item_left" />
                                <HeaderStyle Width="15%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="在职状态" DataField="StatusName">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle Width="5%" CssClass="GridView_head_grayblue" />
                            </asp:BoundField>                            
                            <asp:TemplateField HeaderText="基本信息" ShowHeader="False">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle CssClass="GridView_head_grayblue" Width="5%" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton" runat="server" CausesValidation="False"  Enabled = "true" CommandName="Edit" CommandArgument="<%# ((PersonEmployeeBean)Container.DataItem).EmployeeId %>"
                                        ImageUrl="~/images/in.gif" />
                                </ItemTemplate>
                            </asp:TemplateField>            
                            <asp:TemplateField HeaderText="职位信息" ShowHeader="False">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle CssClass="GridView_head_grayblue" Width="5%" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton3" runat="server" CausesValidation="False"  Enabled = "true" CommandName="Job" CommandArgument="<%# ((PersonEmployeeBean)Container.DataItem).EmployeeId %>"
                                        ImageUrl="~/images/in.gif" />
                                </ItemTemplate>
                            </asp:TemplateField>                                                                        
                            <asp:TemplateField HeaderText="转正" ShowHeader="False">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle CssClass="GridView_head_grayblue" Width="5%" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False"  Enabled = "true" CommandName="UpdStatus1" CommandArgument="<%# ((PersonEmployeeBean)Container.DataItem).EmployeeId %>"
                                        ImageUrl="~/images/info.gif" OnClientClick="javascript:return window.confirm('是否将该员工在职状态由“试用”转为“正式”？')"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="离职" ShowHeader="False">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle CssClass="GridView_head_grayblue" Width="5%" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False"  Enabled = "true" CommandName="UpdStatus-1" CommandArgument="<%# ((PersonEmployeeBean)Container.DataItem).EmployeeId %>"
                                        ImageUrl="~/images/info.gif" OnClientClick="javascript:return window.confirm('是否将该员工在职状态由“在职”转为“离职”？')"/>
                                </ItemTemplate>
                            </asp:TemplateField>                                                            
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle HorizontalAlign="Right" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        
    </div>
</asp:Content>
